package com.feng.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import javax.xml.soap.DetailEntry;
import java.util.Collection;
import java.util.Set;

/**
 * @author: 丰
 * @date: 2022/12/7 12:24
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class User extends BaseEntity implements UserDetails {
    private String username;
    private String password;

    private Character sex;
    private String phone;
    private String email;
    private String address;

    private Collection<? extends GrantedAuthority> authorities;


    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return authorities;
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
